/*
 * @Author: 白印潇 bai_yinxiao@163.com
 * @Date: 2023-01-11 14:04:21
 * @LastEditors: 白印潇 bai_yinxiao@163.com
 * @LastEditTime: 2023-03-23 16:45:28
 * @FilePath: /shortRent-ui/src/api/car/illegal.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'

// 查询违章列表
export function listIllegal(query) {
  return request({
    url: '/car/illegal/list',
    method: 'get',
    params: query
  })
}

// 查询违章详细
export function getIllegal(id) {
  return request({
    url: '/car/illegal/' + id,
    method: 'get'
  })
}

// 新增违章
export function addIllegal(data) {
  return request({
    url: '/car/illegal',
    method: 'post',
    data: data,
    mmv: true,
  })
}

// 修改违章
export function updateIllegal(data) {
  return request({
    url: '/car/illegal',
    method: 'put',
    data: data,
    mmv: true,
  })
}

// 删除违章
export function delIllegal(id) {
  return request({
    url: '/car/illegal/' + id,
    method: 'delete'
  })
}

// 导出违章
export function exportIllegal(query) {
  return request({
    url: '/car/illegal/export',
    method: 'get',
    params: query
  })
}

//违章列表统计
export function illegalCount(){
  return request({
    url:'/car/illegal/index',
    method:'get',
  })
}

//违章预警配置
export function illegalSet(){
  return request({
    url:'/car/illegal/violationWarning',
    method:'get',
  })
}

//违章统计
export function illegalStatics(query){
  return request({
    url:'/car/illegal/vehicleViolationStatistics',
    method:'get',
    params:query
  })
}


// 创建违章工单
export function addIllegalWorkOrder(data) {
  return request({
    url: '/car/illegalWorkOrder/insert',
    method: 'post',
    data:data
  })
}


// 查询违章工单分页列表
export function illegalWorkOrderPage(query) {
  return request({
    url: '/car/illegalWorkOrder/page',
    method: 'get',
    params: query
  })
}

// 查询违章工单详情
export function illegalWorkOrderDetail(id) {
  return request({
    url: '/car/illegalWorkOrder/' + id,
    method: 'get'
  })
}

// 违章工单-查询车辆列表
export function illegalWorkOrderCarList(id,query) {
  return request({
    url: '/car/illegalWorkOrder/'+id + '/cars',
    method: 'get',
    params: query
  })
}

// 违章工单-查询违章结果
export function illegalWorkOrderResult(id,query) {
  return request({
    url: '/car/illegalWorkOrder/'+id + '/illegals',
    method: 'get',
    params: query
  })
}

// 违章工单-查询违章结果导出
export function illegalWorkOrderResultExport(id) {
  return request({
    url: '/car/illegalWorkOrder/' +id + '/illegals/export',
    method: 'get'
  })
}



// 获取账户余额信息
export function accountBalanceInfo() {
  return request({
    url: '/account-balance/info',
    method: 'get'
  })
}

// 账户余额充值
export function accountBalanceRecharge(data) {
  return request({
    url: '/account-balance/recharge',
    method: 'post',
    data: data
  })
}

// 账户余额充值消费记录查询
export function accountBalanceRecordList(query) {
  return request({
    url: '/account-balance/record/page',
    method: 'get',
    params: query
  })
}


/**违章查询账户相关接口 */
// 创建违章查询账户
export function illegalAcountCreate(data) {
  return request({
    url: '/illegal_query_account/create',
    method: 'post',
    data: data
  })
}

// 分页查询违章查询账号
export function illegalAccountList(query) {
  return request({
    url: '/illegal_query_account/page',
    method: 'get',
    params: query
  })
}

// 违章查询账号配置公司
export function illegalAcountDeploy(data) {
  return request({
    url: '/illegal_query_account/deploy_org',
    method: 'post',
    data: data
  })
}

// 修改违章查询账号信息
export function upDateIllegalAcount(data) {
  return request({
    url: '/illegal_query_account/update',
    method: 'post',
    data: data
  })
}

// 违章查询账号启用禁用修改
export function upDateIllegalAcountEnable(data) {
  return request({
    url: '/illegal_query_account/update_enable',
    method: 'post',
    data: data
  })
}

// 违章查询账号删除
export function deleteIllegalAcount(data) {
  return request({
    url: '/illegal_query_account/delete',
    method: 'post',
    data: data
  })
}

// 违章查询账号 - 获取所属公司列表
export function illegalAcountOrgList() {
  return request({
    url: '/illegal_query_account/org_list',
    method: 'get'
  })
}

//违章查询地区编码集合
export function illegalAcountAddressList(){
  return request({
    url:'/illegal_query_account/addr_list',
    method:'get',
  })
}

//获取违章查询账号信息
export function illegalAcountDetail(illegalQueryAccountId){
  return request({
    url:'/illegal_query_account/'+illegalQueryAccountId,
    method:'get',
  })
}

//拥有的违章查询账号类型种类
export function illegalAcountContainType(){
  return request({
    url:'/illegal_query_account/contain_type',
    method:'get',
  })
}

//创建违章工单车辆统计数量
export function illegalOrderCarCount(data){
  return request({
    url:'/car/illegalWorkOrder/insert_car_count',
    method: 'post',
    data:data
  })
}